package com.suikajy.damaiproject.config;

/**
 * Created by suikajy on 2016/12/12.
 */

public class UrlConfig {

    private static final String CLASS_BASE_URL1 = "http://mapi.damai.cn/ProjLst.aspx?source=10101&cc=0&ps=20";
    private static final String CLASS_BASE_URL2 = "&ot=0&v=0&appType=1&osType=2&version=50609&channel_from=xiaomi_market&cityId=852";
    private static final String IMAGE_BASE_URL = "http://pimg.dmcdn.cn/perform/project/";

    public static String getClassUrlByMc(int mc, int page) {
        return CLASS_BASE_URL1 + "&mc=" + mc + CLASS_BASE_URL2 + "&p=" + page;
    }

    public static String getImageUrl(int imageId) {
        //"http://pimg.dmcdn.cn/perform/project/1124/112442_n.jpg";
        String id = String.valueOf(imageId);
        return IMAGE_BASE_URL + id.substring(0, 4) + "/" + id + "_n.jpg";
    }
}
